// `Centimeters`,可以比较元组结构体
#[derive(PartialEq, PartialOrd)]
struct Centimeters(f64);
// `Inches`,可以打印的元组结构体
#[derive(Debug)]
struct Inches(i32);
impl Inches {
    fn to_centimeters(&self) -> Centimeters {
        let &Inches(inches) = self;
        Centimeters(inches as f64 * 2.54)
    }
}
// `Seconds`,不带派生属性的元组结构体
struct Seconds(i32);

fn main() {
    let _one_second = Seconds(1);
//     下面一行会报错，因为`Seconds`没有实现`Debug`
//     println!("One second looks like: {:?}", _one_second);
    let foot = Inches(12);
    println!("One foot equals {:?}", foot);
    let meter = Centimeters(100.0);
    let cmp = if foot.to_centimeters() < meter {
        "smaller"
    } else {
        "bigger"
    };
    println!("One foot is {} than one meter.", cmp);

}